<template>
  <svg
    class="c-icon"
    :class="{ vm }"
    :style="{ width: width || size + 'px', height: height || size + 'px' }"
  >
    <use :xlink:href="`#${icon}`" />
  </svg>
</template>

<script setup lang="ts">
defineProps({
  vm: {
    type: Boolean,
    default: false,
  },
  icon: {
    type: String,
    default: 'default',
  },
  size: {
    type: Number,
  },
  width: {
    type: Number,
  },
  height: {
    type: Number,
  },
});
</script>

<style lang="less">
.c-icon {
  display: inline-block;
  width: 18px;
  height: 18px;
  stroke-width: 0;
  stroke: currentColor;
  fill: currentColor;
  vertical-align: text-top;
  &.vm {
    vertical-align: middle;
  }
}
</style>
